package com.id.coinscleaner.junk

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.lifecycleScope
import com.id.coinscleaner.R
import com.id.coinscleaner.common.ViewBindingFragment
import com.id.coinscleaner.databinding.FragmentJunkScanBinding
import com.id.coinscleaner.viewmodel.JunkViewModel
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch


class JunkScanFragment : ViewBindingFragment<FragmentJunkScanBinding>() {

    val viewModel by lazy { ViewModelProvider(this.requireActivity()).get(JunkViewModel::class.java) }
    override fun initView() {
        super.initView()
        lifecycleScope.launch {
            viewModel.initData()
            delay(2000)
            navigate(R.id.action_junkScanFragment_to_junkShowFragment)
        }
        binding.backIV.setOnClickListener {
            requireActivity().finish()
        }
    }


}